package com.application.viewmodel;

import android.widget.Toast;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import com.application.R;

import java.util.ArrayList;
import java.util.List;

public class FirstViewModel extends ViewModel {
    private final MutableLiveData<List<String>> tabTitles = new MutableLiveData<>();

    public FirstViewModel() {
        List<String> titles = new ArrayList<>();
        titles.add("首页");
        titles.add("音乐");
        titles.add("电影");
        tabTitles.setValue(titles);
    }

    public MutableLiveData<List<String>> getTabTitles() {
        return tabTitles;
    }

    public String handleNavigationItemClick(int itemId) {
        if (itemId == R.id.it_chatperson) {
            return "chatperson";
        } else if (itemId == R.id.it_exit) {
            return "exit";
        } else if (itemId == R.id.it_gotochat) {
            return "gotochat";
        } else if (itemId == R.id.it_name) {
            return "name";
        } else if (itemId == R.id.it_title) {
            return "title";
        }
        return "";
    }
}
